package com.aichongbang.acb.service.impl;

import com.aichongbang.acb.po.ItemOrder;
import com.aichongbang.acb.mapper.ItemOrderMapper;
import com.aichongbang.acb.service.IItemOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author acb
 * @since 2021-05-31
 */
@Service("itemOrderService")
public class ItemOrderServiceImpl extends ServiceImpl<ItemOrderMapper, ItemOrder> implements IItemOrderService {

    @Resource
    private ItemOrderMapper itemOrderMapper;

    @Override
    public List<ItemOrder> getAllOrders() {
        return itemOrderMapper.getAllOrders();
    }

    @Override
    public List<ItemOrder> queryOrders(ItemOrder itemOrder) {
        List<ItemOrder> list = itemOrderMapper.queryOrders(itemOrder);
        return list;
    }

    @Override
    public ItemOrder getOrderById(Integer tId) {
        return itemOrderMapper.getOrderById(tId);
    }

    @Override
    public boolean updateItemOrder(ItemOrder itemOrder) {
        int n = itemOrderMapper.updateById(itemOrder);
        return n > 0 ? true : false;
    }
}
